<%@page import="org.ly.dq.bean.WeiXiu"%>
<%@page import="java.text.DateFormat"%>
<%@page import="java.util.Date"%>
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<%@ include file="/WEB-INF/views/include/head.jsp"%>
<script type="text/javascript">
	/* 	$(document).ready(function() {
	 $( "#nbaoXiuRiQi" ).datepicker({
	 changeMonth:true,              //月选项
	 changeYear: true,              //年选项
	 dateFormat:"yy-mm-dd",  //时间格式
	 showButtonPanel: true, //显示面板底部按钮
	 closeTextType:"关闭", //关闭按钮文字
	 currentText: "今天",   //返回今天按钮文字
	 dayNamesMin:['天','一','二','三','四','五','六'],               //星期显示
	 monthNamesShort:['1','2','3','4','5','6','7','8','9','10','11','12']       //月份显示
	 });
	 }); */

	$(document).ready(
			function() {
				$("#nbaoXiuRiQi")
						.datepicker(
								{
									//defaultDate: "+1w",
									numberOfMonths : 2,
									changeMonth : true, //月选项
									changeYear : true, //年选项
									dateFormat : "yy-mm-dd", //时间格式
									showButtonPanel : true, //显示面板底部按钮
									closeTextType : "关闭", //关闭按钮文字
									currentText : "今天", //返回今天按钮文字
									dayNamesMin : [ '天', '一', '二', '三', '四',
											'五', '六' ], //星期显示
									monthNamesShort : [ '1', '2', '3', '4',
											'5', '6', '7', '8', '9', '10',
											'11', '12' ], //月份显示
									onClose : function(selectedDate) {
										$("#ebaoXiuRiQi").datepicker("option",
												"minDate", selectedDate);
									}
								});
				$("#ebaoXiuRiQi")
						.datepicker(
								{
									//defaultDate: "+1w",
									numberOfMonths : 2,
									changeMonth : true, //月选项
									changeYear : true, //年选项
									dateFormat : "yy-mm-dd", //时间格式
									showButtonPanel : true, //显示面板底部按钮
									closeTextType : "关闭", //关闭按钮文字
									currentText : "今天", //返回今天按钮文字
									dayNamesMin : [ '天', '一', '二', '三', '四',
											'五', '六' ], //星期显示
									monthNamesShort : [ '1', '2', '3', '4',
											'5', '6', '7', '8', '9', '10',
											'11', '12' ]
								//月份显示
								});

				//判断时间
				var tr = $(".weixiu")
			});

	function clearVal() {
		window.location.href = $("#url").attr("value");
	}
</script>


<style type="text/css">
.weixiudate {
	background-color: yellow;
	 color : red;
	font-weight: bold;
	font-size: 150%;
	font-weight: bold;
	color: red;
}
</style>
</head>
<body>
	<form name="listFrom" id="listFrom" method="post"
		action="${ctx}/WeiXiu/list">
		<input type="hidden" name="page" id="page" value="" /> <input
			type="hidden" id="url" name="url" value="${obj.url}">
			<input type="hidden" name="params.wxZhuangTai" id="wxZhuangTai" value="${obj.params.wxZhuangTai}" />
		<tr>
			<td height="30">
				<table width="100%" border="0" cellspacing="0" cellpadding="0">
					<tr>
						<td height="62" background="${ctxStatic}/images/nav04.gif">
							<!--  -->
							<table width="98%" border="0" align="center" cellpadding="0"
								cellspacing="0">
								<tr>
									<td width="21"><img src="${ctxStatic}/images/ico07.gif"
										width="20" height="18" /></td>
									<td width="538">维修单号: <input id="dingDanHao"
										name="params.dingDanHao" value="${obj.params.dingDanHao}"
										type="text" class="clear" /> 外机条码: <input id="waiJiTiaoMa"
										name="params.waiJiTiaoMa" value="${obj.params.waiJiTiaoMa}"
										type="text" class="clear" /> 内机条码: <input id="tiaoMa"
										name="params.tiaoMa" value="${obj.params.tiaoMa}" type="text"
										class="clear" /> 维修人: <select class="required"
										name="params.weiXiuRen" id="weiXiuRen">
											<option value="" class="clear">---请选择---</option>
											<c:forEach items="${obj.shiFus}" var="shifu">
												<option value="${shifu.shiFuName}"
													<c:if test="${shifu.shiFuName eq obj.params.weiXiuRen}">selected="selected"</c:if>>${shifu.shiFuName}</option>
											</c:forEach>
									</select> 品牌:<select class="required" name="params.pingPaiHao"
										id="pingPaiHao">
											<option value="" class="clear">---请选择---</option>
											<c:forEach items="${obj.pingPais}" var="pingpai">
												<option value="${pingpai.pingPaiName}"
													<c:if test="${pingpai.pingPaiName eq obj.params.pingPaiHao}">selected="selected"</c:if>>${pingpai.pingPaiName}</option>
											</c:forEach>
									</select><br /> 用户姓名:<input name="params.yongHuName"
										value="${obj.params.yongHuName}" style="width: 80px;"
										type="text" class="clear" /> 用户电话:<input
										name="params.yongHuPhone" value="${obj.params.yongHuPhone}"
										type="text" class="clear" /> <label for="nbaoXiuRiQi">开&nbsp;&nbsp;始：</label>
										<input type="text" id="nbaoXiuRiQi" name="params.nbaoXiuRiQi"
										value="${obj.params.nbaoXiuRiQi}" readonly="readonly"
										class="clear"> <label for="ebaoXiuRiQi">结&nbsp;&nbsp;束：</label>
										<input type="text" id="ebaoXiuRiQi" name="params.ebaoXiuRiQi"
										value="${obj.params.ebaoXiuRiQi}" readonly="readonly"
										class="clear"> <input name="Submit4" type="submit"
										class="right-button02" value="查 询" /> <input name="clear"
										type="button" class="right-button02" value="清 空"
										onclick="clearVal()" />
									</td>
								</tr>
							</table>
						</td>
					</tr>
				</table>
			</td>
		</tr>
		<tr>
			<td>
				<table id="subtree1" width="100%" border="0" cellspacing="0"
					cellpadding="0">
					<tr>
						<td>
							<table width="95%" border="0" align="center" cellpadding="0"
								cellspacing="0">
								<tr>
									<td height="40" class="font42">
										<table width="100%" border="0" cellpadding="4" cellspacing="1"
											bgcolor="#464646" class="newfont03">
											<tr class="CTitle">
											<c:if test="${obj.params.wxZhuangTai == 2}">
											<td height="22" colspan="12" align="center"
													style="font-size: 16px">已维修订单列表</td>
											</c:if>
											
											
											<c:if test="${obj.params.wxZhuangTai == 1}">
											<td height="22" colspan="12" align="center"
													style="font-size: 16px">未维修订单列表</td>
											</c:if>
											</tr>
											<tr bgcolor="#EEEEEE" height="22px">
												<td width="5%" align="center">编号</td>
												<td width="10%" align="center">维修订单号</td>
												<td width="5%" align="center">维修人</td>
												<td width="5%" align="center">用户姓名</td>
												<td width="10%" align="center">用户电话</td>
												<td width="10%" align="center">品牌</td>
												<td width="10%" align="center">报修日期</td>
												<td width="5%" align="center">录入人</td>
												<td width="5%" align="center">维修状态</td>
												<td width="5%" align="center">配件状态</td>
												<td width="10%" align="center">维修措施</td>
												<td width="20%" align="center">功&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;能</td>
											</tr>
											<c:forEach items="${obj.list}" var="wxdate">
												<tr bgcolor="#FFFFFF" height="50px"
													<c:if test="${wxdate.dateFlag eq 0 && wxdate.wXiu.zhuangTai eq 1}">class="weixiudate"</c:if>>
													<td>${wxdate.wXiu.weiXiuId}</td>
													<td>${wxdate.wXiu.dingDanHao}</td>
													<td>${wxdate.wXiu.weiXiuRen}</td>
													<td>${wxdate.wXiu.yongHuName}</td>
													<td>${wxdate.wXiu.yongHuPhone}</td>
													<td>${wxdate.wXiu.pingPaiHao}</td>
													<td class="bxrq"><fmt:formatDate
															value="${wxdate.wXiu.baoXiuRiQi}" pattern="yyyy-MM-dd" /></td>
													<td>${wxdate.wXiu.luRuRen}</td>
													<td><c:if test="${wxdate.wXiu.zhuangTai == 2}">已维修</c:if>
														<c:if test="${wxdate.wXiu.zhuangTai == 1}">未维修</c:if></td>
													<td><c:if test="${wxdate.wXiu.wuLiaos.size() != 0}">已申请</c:if>
														<c:if test="${wxdate.wXiu.wuLiaos.size() == 0}">未申请</c:if></td>
													<td>${wxdate.wXiu.weiXiuCuoShi}</td>
													<td align="center"><c:if
															test="${wxdate.wXiu.zhuangTai == 1}">
															<a
																href="${ctx }/WeiXiu/edit?weiXiuId=${wxdate.wXiu.weiXiuId }">修改</a>&nbsp;&nbsp;
                                                    </c:if> <a
														href="${ctx }/WeiXiu/view?weiXiuId=${wxdate.wXiu.weiXiuId }">查看</a>&nbsp;&nbsp;
														<c:if test="${username == 'admin'}">
															<a
																href="${ctx }/WeiXiu/delete?weiXiuId=${wxdate.wXiu.weiXiuId}&params.wxZhuangTai=${obj.params.wxZhuangTai}">删除</a>&nbsp;&nbsp;
                                                    </c:if> <c:if
															test="${wxdate.wXiu.zhuangTai == 1}">
															<a
																href="${ctx }/WeiXiu/ok?weiXiuId=${wxdate.wXiu.weiXiuId}&params.wxZhuangTai=2">已维修</a>&nbsp;&nbsp;
                                                    </c:if></td>
												</tr>
											</c:forEach>
										</table>
									</td>
								</tr>
							</table>
							<table width="95%" border="0" align="center" cellpadding="0"
								cellspacing="0">
								<tr>
									<td height="6"><img src="${ctxStatic}/images/spacer.gif"
										width="1" height="1" /></td>
								</tr>
								<tr>
									<tags:page pageNumber="${obj.pager.pageNumber}"
										pageCount="${obj.pager.pageCount}" formid="listFrom"></tags:page>
								</tr>
							</table>
						</td>
					</tr>
				</table>
	</form>
</body>
</html>